import { Component, OnInit, ViewChild } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { _HttpClient } from '@delon/theme';
import { ControlWidget, SFSchema, SFUISchema } from '@delon/form';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';

@Component({
  selector: 'app-message-notice-edit',
  templateUrl: './edit.component.html',
})
export class MessageNoticeEditComponent implements OnInit {
  form: FormGroup;
  submitting = false;
  record: any = {};
  i: any;
  config: {};
  loading: string;
  delay: number;
  value = '';
  constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, private fb: FormBuilder) {}

  ngOnInit(): void {
    // this.loading = this.ui.loading || '加载中……';
    // this.config = this.ui.config || {};
    // this.delay = this.ui.delay || 300;

    this.form = this.fb.group({
      title: [null, [Validators.required]],
      date: [null, [Validators.required]],
      goal: [null, [Validators.required]],
      standard: [null, [Validators.required]],
      client: [null, []],
      invites: [null, []],
      weight: [null, []],
      public: [1, [Validators.min(1), Validators.max(3)]],
      public2: [1, [Validators.min(1), Validators.max(3)]],
      publicUsers: [null, []],
    });
    // this.http.get(`/user/${this.record.id}`).subscribe(res => (this.i = res));
  }
}
